<template>
  <div id="ProductTable">
    <el-table
      :data="specList"
      border
      style="width: 100%"
      empty-text="请至少添加一条规格"
    >
      <el-table-column
        prop="specName"
        label="规格名称">
      </el-table-column>
      <el-table-column
        prop="originalPrice"
        label="原价">
      </el-table-column>
      <el-table-column
        prop="discountPrice"
        label="现价">
      </el-table-column>
      <el-table-column
        prop="creditPrice"
        label="积分价">
      </el-table-column>
      <el-table-column
        prop="inventory"
        label="库存">
      </el-table-column>
      <el-table-column
        v-if="isSelectTicket"
        prop="ticketTxt"
        label="优惠券">
      </el-table-column>
      <el-table-column
        label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small"
            @click="$emit('editOneSpec', scope.$index)">编辑</el-button>
          <el-button type="text" size="small" style="color: red;"
            @click="$emit('deleteOneSpec', scope.$index)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'ProductIndex',
  props: [
    'specList', 'isSelectTicket'
  ],
  methods: {
  }
}
</script>

<style scoped lang="scss">
  .product_index_main {
    padding: 20px;
  }
</style>
